package easier.window.popup.recycler;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.PopupWindow;
import easier.window.popup.PopupWindowShow;
import easier.window.window.R;

/**
 * 显示一个没有数据的弹窗界面
 */
public class PopupRecyclerEmpty extends PopupWindow {

    public PopupRecyclerEmpty( Context context ) {

        super();
        View view = LayoutInflater.from( context ).inflate( R.layout.popup_window_check_recycler_item_empty, null );
        view.setOnClickListener( new OnClickListener() {
            @Override
            public void onClick( View v ) {

                notifyEmptyClick( v );
            }
        } );
        setContentView( view );
    }

    /**
     * @param anchor 工具方法显示界面,锚点
     */
    public void show( View anchor ) {

        PopupWindowShow.showAsDropDownWithAnchorWidth( this, anchor );
    }

    /**
     * @param v 回调界面点击事件
     */
    protected void notifyEmptyClick( View v ) {

        dismiss();
    }
}